package cn.yuan.cong.test.spring.cloud.server;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/7/4.
 */
@SpringBootApplication
@ComponentScan("cn.yuan.cong.test.spring.cloud.server")
@ServletComponentScan("cn.yuan.cong.test.spring.cloud.server")
@EnableEurekaClient
//@RestController
public class ServerApp {

    @Value("${name:World!}")
    String bar;
    /**
     * jar启动初始化
     *
     * @param args
     */
    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(ServerApp.class);
//        app.addListeners(new SpringBootStartedEventListener());
//        app.addListeners(new SpringBootPreparedEventListener());
        app.run(args);
    }

//    @RequestMapping("get")
//    public Result test(){
//        Result result=new Result();
//        result.setPort(bar);
//        result.setName("");
//        return result;
//    }
}
